/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ceair.flight.refund.util;

import org.apache.commons.codec.binary.Base64;

import java.nio.charset.Charset;

/**
 *
 * @author Colin_You
 */
public final class Base64Util {

    public static String encode(String source) {
        return Base64.encodeBase64URLSafeString(source.getBytes(Charset.forName("UTF-8")));
    }

    public static String decode(String source) {
        Base64 base64 = new Base64();
        return new String(base64.decode(source));
    }

}
